<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户展示页</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <style type="text/css">
        a {
            color: black;
        }
    </style>
</head>
<body>
{% extends 'base.html' %}
{% block title %}首页{% endblock %}
{% block article %}
<!-- 数据展示 -->
<div class="container">
    <table class="table table-hover">
        <!-- 表头 -->
        <thead>
        <tr>
            <th>id</th>
            <th>用户名</th>
            <th>密码</th>
            <th>年龄</th>
            <th>邮箱</th>
            <th>创建时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <!-- 表内容 -->
        <tbody>
        {% for user in users %}
                <tr>
                    <td>{{ user.id }}</td>
                    <td>{{ user.username }}</td>
                    <td>{{ user.password }}</td>
                    <td>{{ user.age }}</td>
                    <td>{{ user.email }}</td>
                    <td>{{ user.createDatetime|date:'Y-m-d H:i:s' }}</td>
                    <td>
                        <a href="{% url 'alter' user.id %}">修改</a>
                        <a href="{% url 'del' user.id %}">删除</a>
                    </td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
</div>
{% endblock %}
</body>
</html>